package com.gopay.bis.service.bank;

import com.gopay.common.constants.bank.BisBankBusinessProd;
import com.gopay.common.constants.bank.BisBankInterfaceChannel;
import com.gopay.common.domain.bis.BaseBisBankConfig;
import com.gopay.common.domain.bis.BaseBisBankExtConfig;
import com.gopay.common.exception.GopayException;
import com.gopay.remote.bank.BankIntrChannConfRemoteService;

/**
 * 银行接口通道服务
 * @author liujy
 *
 */
public interface BankIntrChannConfService extends BankIntrChannConfRemoteService{
	
	/**
	 * 外部清算单位交易代码
	 * 1NNN：账务类(第二位大于等于5批量类)
	 * 2NNN: 冲正退款退回类
	 * 3NNN：查询对账类(第二位大于等于5批量类)
	 * 
	 */
	public static enum OutStlmTranCode{
		
		/** 网银支付 */
		_1000, 
		/** 单笔转账 */
		_1001, 
		/** 批量转账 */
		_1501,
		
		/** 退款 */
		_2000, 
		
		/** 查询 */
		_3000, 
		/** 对账 */
		_3001;
	}
	
	/**
	 * 校验银行业务产品是否支持该通道
	 * @param chCode
	 * @param bankBusProd
	 * @throws GopayException 
	 */
    public void checkBankBussProdAndIntrChan(String chCode,
			String bankBusProd) throws GopayException;
	
    
    /**
     * 校验银行接口通道
     * @param config
     * @param outTranCode
     * @throws GopayException
     */
    public void checkBankIntrChan(BaseBisBankConfig config, OutStlmTranCode outTranCode)throws GopayException;
    
    /**
     * 根据银行业务产品代码、渠道及银行码查询接口配置
     * 
     * @param prod
     * @param channel
     * @param bankCode
     * @return
     */
    public BaseBisBankExtConfig findBaseBisBankExtConfigByBankChannel(BisBankBusinessProd prod,
            BisBankInterfaceChannel channel, String bankCode);
}
